#pragma once
#include <glad/glad.h>
#include <string>

class Texture
{
private:
	GLuint mTextureId;
	unsigned int mTextureUnit;
	int mWidth;
	int mHeight;
public:
	Texture(const std::string filePath, unsigned int textureIndex);
	Texture(const Texture& texture) {
		this->mTextureId = texture.mTextureId;
		this->mTextureUnit = texture.mTextureUnit;
		this->mWidth = texture.mWidth;
		this->mHeight = texture.mHeight;
	}
	Texture(Texture&& texture) noexcept {
		this->mTextureId = texture.mTextureId;
		this->mTextureUnit = texture.mTextureUnit;
		this->mWidth = texture.mWidth;
		this->mHeight = texture.mHeight;

		texture.mTextureId = 0;
		texture.mTextureUnit = 0;
		texture.mWidth = texture.mHeight = 0;
	}
	~Texture() {
		if (mTextureId) {
			glDeleteTextures(1, &mTextureId);
			mTextureId = 0;
		}
	}
	void bindTexture() const;
};

